﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RelationExpertSystem.Relation
{
    public class Wife : RelationBase
    {
        private static Wife _singleton = new Wife();
        public static Wife Instance
        {
            get { return _singleton; }
        }

        private Wife() { }

        public override bool IsRelated(Person a, Person b)
        {
            // b is a's Wife IFF b is female and b is a's spouse
            return b.Sex == Sex.Female && b == a.Spouse;
        }

        public override IEnumerable<IRelation> GetDependencies()
        {
            return new HashSet<IRelation>(new IRelation[] { Spouse.Instance });
        }
    }
}
